import request from '@/utils/request';

// -------------------基础配置-----------------
// 网站配置-获取
export const getSite = params => request({
    url: '/admin/site/set',
    method: 'GET',
    params
});

// 网站配置-保存
export const setSite = params => request({
    url: '/admin/site/set',
    method: 'put',
    data: params
});
// 网站配置-保存
export const menuAll = params => request({
    url: '/admin/site/menuAll',
    method: 'post',
    data: params
});
// -------------------区域管理-----------------
// 区域管理列表
export const regionList = params => request({
    url: '/shop/commonRegion/list',
    method: 'GET',
    params
});
// 区域管理添加
export const regionCreate = params => request({
    url: '/shop/commonRegion/create',
    method: 'POST',
    params
}).then(res => {
    return res;
});
// 区域管理编辑
export const regionUpdate = params => request({
    url: '/shop/commonRegion/update',
    method: 'POST',
    params
}).then(res => {
    return res;
});
// -------------------公共字典-----------------
// 直/经字典列表
export const customerDictList = params => request({
    url: '/admin/CommonDict/list',
    method: 'GET',
    params
});

// 直/经字典添加
export const customerDictCreate = params => request({
    url: '/admin/CommonDict/create',
    method: 'POST',
    data: params
});

// 直/经字典更新
export const customerDictUpdate = params => request({
    url: '/admin/CommonDict/update',
    method: 'POST',
    data: params
});
// -------------------Android版本-----------------
// app(android)配置保存
export const androidApp = params => request({
    url: '/admin/commonSet/androidApp',
    method: 'put',
    data: params
});

//  app(android)配置获取
export const getAndroidApp = params => request({
    url: '/admin/commonSet/androidApp',
    method: 'GET',
    params
}).then(({ data }) => {
    return data;
});
// -------------------Android版本-----------------
// app(ios)配置保存
export const iosApp = params => request({
    url: '/admin/commonSet/iosApp',
    method: 'put',
    data: params
});

//  app(ios)配置获取
export const getIosApp = params => request({
    url: '/admin/commonSet/iosApp',
    method: 'GET',
    params
}).then(({ data }) => {
    return data;
});

//  app更新日志
export const appUpdateLog = params => request({
    url: '/admin/CommonAppUpdateLog/index',
    method: 'GET',
    params
}).then(({ data }) => {
    return data;
});

// -------------------访问配置-----------------
// 列表配置
export const webConf = params => request({
    url: '/admin/webConf/list',
    method: 'GET',
    params
});

// 业态添加
export const webConfCreate = params => request({
    url: '/admin/webConf/create',
    method: 'POST',
    data: params
});

// 业态添加
export const webConfUpdate = params => request({
    url: '/admin/webConf/update',
    method: 'POST',
    data: params
});
